package cn.chengpengper.netdisk.controller;

import cn.chengpengper.netdisk.controller.request.AccountRegisterReq;
import cn.chengpengper.netdisk.service.AccountService;
import cn.chengpengper.netdisk.util.JsonData;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/account")
public class AccountController {

    @Resource
    private AccountService accountService;

    @PostMapping("/v1/register")
    public JsonData register(@RequestBody AccountRegisterReq req) {
        accountService.register(req);
        return JsonData.buildSuccess();
    }
}
